package soccerBet.project.objects;
// Generated 22/Dez/2013 22:11:24 by Hibernate Tools 3.2.2.GA


import java.util.Date;
import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * Precos generated by hbm2java
 */
@Entity
@Table(name="precos"
)
public class Precos  implements java.io.Serializable {


     private Integer idPrecos;
     private Runner runner;
     private Double back;
     private Double lay;
     private Date data;
     private Integer selectionId;
     private int placedBet;
     private Set<InfoPrecos> infoPrecoses = new HashSet<InfoPrecos>(0);

    public Precos() {
    }

	
    public Precos(Runner runner, int placedBet) {
        this.runner = runner;
        this.placedBet = placedBet;
    }
    public Precos(Runner runner, Double back, Double lay, Date data, Integer selectionId, int placedBet) {
       this.runner = runner;
       this.back = back;
       this.lay = lay;
       this.data = data;
       this.selectionId = selectionId;
       this.placedBet = placedBet;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idPrecos", unique=true, nullable=false)
    public Integer getIdPrecos() {
        return this.idPrecos;
    }
    
    public void setIdPrecos(Integer idPrecos) {
        this.idPrecos = idPrecos;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idRunner", nullable=false)
    public Runner getRunner() {
        return this.runner;
    }
    
    public void setRunner(Runner runner) {
        this.runner = runner;
    }
    
    @Column(name="back", precision=22, scale=0)
    public Double getBack() {
        return this.back;
    }
    
    public void setBack(Double back) {
        this.back = back;
    }
    
    @Column(name="lay", precision=22, scale=0)
    public Double getLay() {
        return this.lay;
    }
    
    public void setLay(Double lay) {
        this.lay = lay;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="data", length=19)
    public Date getData() {
        return this.data;
    }
    
    public void setData(Date data) {
        this.data = data;
    }
    
    @Column(name="selectionId")
    public Integer getSelectionId() {
        return this.selectionId;
    }
    
    public void setSelectionId(Integer selectionId) {
        this.selectionId = selectionId;
    }
    
    @Column(name="placedBet", nullable=false)
    public int getPlacedBet() {
        return this.placedBet;
    }
    
    public void setPlacedBet(int placedBet) {
        this.placedBet = placedBet;
    }

    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="precos")
    public Set<InfoPrecos> getInfoPrecoses() {
        return this.infoPrecoses;
    }
    
    public void setInfoPrecoses(Set<InfoPrecos> infoPrecoses) {
        this.infoPrecoses = infoPrecoses;
    }




}


